Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TileMapEditor Fix preview rendering and transform calculations #74982

Merged

Conversation

kleonc
Copy link
Member

@kleonc kleonc commented Mar 16, 2023

  • Makes the preview tile rects be properly transformed. Previously the transform was applied to the tile rect before sending the draw command to the rendering server. Doing so resulted in obtaining the AABB (here box = rect) of the actual potentially not axis aligned rect, and that's what was send to be drawn. Now an untransformed local tile rect is send, and its transform is applied on top of the canvas item used for drawing on the rendering server.

Example for a skewed TileMap:

Before After
s5LxtbAqeS v6nyYY5kOA

Fixes #74969.


  • Makes the calculations for input/rendering include the canvas transform the given TileMap is in.

Example for a TileMap in rotated and scaled CanvasLayer:

Before After
670IxE1vfp m8tjLy7LFM

  • Makes grid fading be properly calculated for selections of more than one tile:
Before After
qXtxX89hS6 godot windows editor dev x86_64_QVyHPvmvzw

@YuriSizov YuriSizov merged commit 6e5713c into godotengine:master Mar 20, 2023
@YuriSizov
Copy link
Contributor

Thanks!

@kleonc kleonc deleted the tile-map-editor-fix-preview-transforms branch March 20, 2023 15:43
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.0.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tilemap preview visual skewed incorrectly
3 participants